package com.shaobufan.museum.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 用户-展览-时刻 中间表
 * @TableName user_exhibit_moment
 */
@TableName(value ="user_exhibit_moment")
@Data
public class UserExhibitMoment implements Serializable {
    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 展览id
     */
    @TableField(value = "ex_id")
    private Integer exId;

    /**
     * 时刻id
     */
    @TableField(value = "mo_id")
    private Integer moId;

    /**
     * 逻辑删除
     */
    @TableField(value = "is_delete")
    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserExhibitMoment other = (UserExhibitMoment) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getExId() == null ? other.getExId() == null : this.getExId().equals(other.getExId()))
            && (this.getMoId() == null ? other.getMoId() == null : this.getMoId().equals(other.getMoId()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getExId() == null) ? 0 : getExId().hashCode());
        result = prime * result + ((getMoId() == null) ? 0 : getMoId().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", exId=").append(exId);
        sb.append(", moId=").append(moId);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}